home *** CD-ROM | disk | FTP | other *** search
/ MIDICraft's MIDINET CD-ROM / MIDICraft's MIDINET CD-ROM.iso / DOSUTILS / MIDITRIM.DOC < prev    next >
Text File  |  1997-03-03  |  7KB  |  200 lines

  1.         ******************************
  2.             MIDITRIM v1.1
  3.     
  4.         midi binaries to general midi
  5.               by Guenter Nagler 
  6.                 1996
  7.           (gnagler@ihm.tu-graz.ac.at)
  8.         ******************************
  9.  
  10. [0] FEATURES
  11.     + reads a binary midi file
  12.     + writes a binary midi file
  13.     + removes delays at beginning and end of midi song
  14.     + reduces time between events that are before first note and after 
  15.       last relevant note event
  16.     + can trim pauses at start, at end or at both sides
  17.  
  18. [1] BACKGROUND
  19. Some midi files have long starting time and that only because of delays
  20. entered by author or its sequencer. Also at end of midifiles sometimes
  21. are large delays where no notes are played until the midi song is finished.
  22.  
  23. This is no problem if using an interactive midi player where you can
  24. manually skip a part of a midi or stop the song to start the next one in
  25. playing list.
  26.  
  27. But if it is wanted that the song list plays without interaction it is
  28. annoying if there are midi files in the list that contain a delay that
  29. is not part of music.
  30.  
  31. This program reads a midi file (format 0 or 1) and searches the points
  32. where music stars playing and music finishes. If there are mute delays at
  33. start or at the end of the song the program produces a midi files that
  34. doesn't contain these delays.
  35.  
  36. The program cannot remove delays that are inside the song, which could
  37. be midi file errors or sequencing failure.
  38.  
  39. [2] FILES DESCRIPTION
  40.  
  41. MIDITRIM.EXE.........converter program for removing delays at start and end
  42. MIDITRIM.DOC.........this file, showing usage of MIDITRIM.EXE
  43. MIDIIO.HPP..........header file for a c++ midi parser
  44. MIDIIO.CPP..........source code for a c++ midi parser
  45. MIDITRIM.CPP.........c++ source code for modifying midi files
  46. MIDITRIM.MAK.........make file for project
  47. MIDITRIM.CFG.........compiler options for make
  48. MIDITRIM.PRJ.........compiler project for Borland (tm) c++ compilers
  49. only MIDITRIM.EXE is required to run program
  50.  
  51. [3] COPYRIGHT
  52.  
  53. MIDITRIM (c) 1996 was created by Guenter Nagler.
  54.  
  55. MIDITRIM is free and may be used as you wish with this one exception:
  56.  
  57.     You may NOT charge any fee or derive any profit for distribution
  58.     of MIDITRIM.  Thus, you may NOT sell or bundle MIDITRIM with any
  59.     product in a retail environment (shareware disk distribution, CD-ROM,
  60.     etc.) without permission of the author.
  61.  
  62. You may give MIDITRIM to your friends, upload it to a BBS, or ftp it to
  63. another internet site, as long as you don't charge anything for it.
  64.  
  65. [4] DISCLAIMER
  66.  
  67. MIDITRIM was designed to handle only 100% compatible midi files.
  68. Treat the program as an experiment and keep your originals until
  69. you are sure that the conversion results satisfy your desire.
  70. If you find a midi file that you think to be 100% compatible midi
  71. that is not correctly converted, please send a sample file to 
  72. gnagler@ihm.tu-graz.ac.at . 
  73.  
  74. Use MIDITRIM at your own risk.  Anything you do with MIDITRIM is your
  75. responsibility, and not the author's.  Any damage caused to any person,
  76. computer, software, hardware, company, or business by running MIDITRIM
  77. is your responsibility, and the author will not be liable.
  78.  
  79. If you don't understand these terms, or are not sure of something, or
  80. are afraid something bad might come of using MIDITRIM, don't  use  it!
  81. You are here forewarned.
  82.  
  83. [5] INSTALLATION
  84.  
  85. [MSDOS]
  86. Simply copy MIDITRIM.EXE in a directory that is in your path.
  87. When you start the program without arguments
  88.  
  89. [UNIX]
  90. compile sources with your C++ compiler (e.g. GNU Compiler g++):
  91.  
  92. g++ -o miditrim miditrim.cpp midiio.cpp
  93.  
  94. and run program
  95.  
  96. $ miditrim
  97.  
  98. C:\> MIDITRIM
  99.  
  100. you should get the usage text (see next section)
  101.  
  102. [6] USAGE
  103.  
  104. miditrim removes pauses at beginning and end of song
  105. usage: miditrim [-start] [-end] [-both] file.mid [newfile.mid]
  106. -start        remove pauses before first note in song is played
  107. -end        remove pauses after last note in song has stopped
  108. -both        trim start and end of song (is default)
  109.  
  110. The parts in brackets [...] are optional.
  111.  
  112. When miditrim is started with only one parameter, the midi file will be
  113. analysed. The results show if trimming at start or at end is possible.
  114.  
  115. Hidden option -version shows program version.
  116. By default miditrim trims both sides (start and end) of the midi song.
  117. If used with option -start or -end only the specified side will be considered
  118. for trimming. Using -start and -end at same time has same effect as option
  119. -both. Option -both is default if none of arguments -start and -end are
  120. specified.
  121.  
  122. start:  miditrim removes pauses from beginning of song till start of first note.
  123. end:    miditrim removes pauses from last stopped note till end of song.
  124.  
  125. Warning:
  126. MIDITRIM will overwrite newfile.mid without warning!
  127. Keep the original file until you don't need it anymore. The newfile.mid
  128. cannot be converted back to the original file!
  129.  
  130. Warning:
  131. Some Sysex commands require pauses to work properly. Usually these commands
  132. are used before start of the song for initialization.
  133. For such cases option -end should be used instead of default option -both
  134. or -start, to leave the necessary pauses inside the midi file.
  135.  
  136. [8] SUGGESTIONS / COMMENTS / BUG REPORTS / QUESTIONS
  137.  
  138.          WWW:    http://hgiicm.tu-graz.ac.at/Cpub
  139.           contains all my dos/unix midi programs
  140.          EMAIL:  gnagler@ihm.tu-graz.ac.at
  141.  
  142. [9] USE
  143. example: get the current program version
  144. command> miditrim -version
  145. miditrim v1.0 by Günter Nagler (Oct 05 1996)
  146.  
  147. example: get information about delays at beginning and end 
  148. command> miditrim file1.mid
  149. first event: 0
  150. last event: 80773
  151. first note: 0
  152. last note: 60480
  153. end: 80773
  154. pause 60480-80773 could be trimmed.
  155.  
  156. The values are midi units which are between 0 (start) and the value end.
  157. first/last event are the range of units where any midi events occured.
  158. first/last note are the range of units where notes are played.
  159. There is no delay between start and first note (both 0).
  160. There is a large delay between last note and end (60480-80773).
  161. This delay could be worth to be trimmed.
  162.  
  163. Hint: miditrim will remove the pauses 
  164.    start (0)  till   first note   
  165. and 
  166.    last note  till   end
  167.  
  168. example: trim file1.mid into new file file2.mid
  169. command> miditrim file1.mid file2.mid
  170. output written to file2.mid
  171.  
  172. command> miditrim file2.mid
  173. first event: 0
  174. last event: 60480
  175. first note: 0
  176. last note: 60480
  177. end: 60480
  178. file1.mid is already trimmed.
  179.  
  180. command> miditrim -start file1.mid file2.mid
  181. output written to file2.mid
  182.  
  183. Pauses at start of song (if available) are removed till first note starts
  184. playing.
  185.  
  186. command> miditrim -end file1.mid file2.mid
  187. output written to file2.mid
  188.  
  189. Pauses at end of song (if available) are removed after last note stopped
  190. playing.
  191.  
  192. command> miditrim file2.mid
  193. first event: 0
  194. last event: 60480
  195. first note: 0
  196. last note: 60480
  197. end: 60480
  198. file1.mid is already trimmed.
  199.  
  200.